#ifndef __DICTIONARY_H__
#define __DICTIONARY_H__

#include <map>
#include <set>

using std::map;
using std::set;
using std::string;

class Dictionary
{
public:
    Dictionary() {}
    ~Dictionary() {}

    static Dictionary *createInstance();
    void init(const string &dictpath);
    map<string, int> &getDict();
    map<string, set<int>> &getIndexTable();
    string doQuery(string word);

private:
    map<string, int> _dict;
    map<string, set<int>> _indexTable;
};

#endif
